<template>
    <van-sticky>
        <van-nav-bar title="搜索" left-text="返回" left-arrow @click-left="onClickLeft" />
    </van-sticky>
    <van-search v-model="value" placeholder="请输入搜索关键词" />
    <router-link >  
             <van-card v-for="i in ssdata"  :desc="i.goods_name"  /> 
    </router-link>
</template>

<script setup>
import { ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import { ss } from '@/api/api';
const router = new useRouter()
const onClickLeft = () => router.go(-1);
const ssdata = ref([])
const value = ref('');

watch(value, (value) => {
    ss(value).then(res => {
        console.log('搜索', res)
        ssdata.value = res.data.messgae
    })
})

</script>

<style lang="scss" scoped></style>